package org.example.myleet.p658;

import org.example.myleet.Utils.Assert;
import org.example.myleet.Utils.JsonUtils;

public class Main {
    public static void main(String[] args) {
        Solution solution = new Solution();
        Assert.isTrue("[1]".equals(JsonUtils.toJson(solution.findClosestElements(new int[]{1,3}, 1, 2))));
        Assert.isTrue("[5,5,6,6,7,7,8]".equals(JsonUtils.toJson(solution.findClosestElements(new int[]{1,2,5,5,6,6,7,7,8,9}, 7, 7))));
        Assert.isTrue("[0,1,1,1,2,3,6,7,8]".equals(JsonUtils.toJson(solution.findClosestElements(new int[]{0,1,1,1,2,3,6,7,8,9}, 9, 4))));
        Assert.isTrue("[1,2,3,4]".equals(JsonUtils.toJson(solution.findClosestElements(new int[]{1,2,3,4,5}, 4, 3))));
        Assert.isTrue("[1,2,3,4]".equals(JsonUtils.toJson(solution.findClosestElements(new int[]{1,2,3,4,5}, 4, -1))));
        Assert.isTrue("[2,3,4,5]".equals(JsonUtils.toJson(solution.findClosestElements(new int[]{1,2,3,4,5}, 4, 4))));
        Assert.isTrue("[1,2,3,4,5]".equals(JsonUtils.toJson(solution.findClosestElements(new int[]{1,2,3,4,5}, 5, 4))));
        Assert.isTrue("[2,3,4]".equals(JsonUtils.toJson(solution.findClosestElements(new int[]{1,2,3,4,5}, 3, 3))));
        Assert.isTrue("[5]".equals(JsonUtils.toJson(solution.findClosestElements(new int[]{1,2,3,4,5}, 1, 6))));
        Assert.isTrue("[4,5]".equals(JsonUtils.toJson(solution.findClosestElements(new int[]{1,2,3,4,5}, 2, 6))));
        Assert.isTrue("[3,4,5]".equals(JsonUtils.toJson(solution.findClosestElements(new int[]{1,2,3,4,5}, 3, 6))));
    }
}
